package com.xbongbong.paas.service.workflow.setting;

import com.xbongbong.paas.pojo.workflow.WorkflowNodeTreePojo;
import com.xbongbong.paas.pojo.workflow.nodes.vo.WorkflowNodeGetVO;
import com.xbongbong.paas.pojo.workflow.settings.WorkflowGetPojo;
import com.xbongbong.paas.pojo.workflow.settings.vo.WorkflowEnableVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.workflow.domain.entity.WorkflowNodeEntity;
import com.xbongbong.workflow.domain.entity.ext.WorkflowNodeEntityExt;

import java.util.Map;

/**
 * @author 吴峰
 * @date 2021/05/21 14:33
 */
public interface WorkflowNodeSettings {

    /**
     * 返回节点类型
     * @return
     */
    Integer type();

    /**
     * 获取节点描述信息
     * @param workflowNodeEntity
     * @param workflowGetPojo
     * @return
     * @throws XbbException
     */
    WorkflowNodeTreePojo getContent(WorkflowNodeEntity workflowNodeEntity, WorkflowGetPojo workflowGetPojo) throws XbbException;

    /**
     * 获取节点详情
     * @param workflowNodeEntity
     * @return
     * @throws XbbException
     */
    WorkflowNodeGetVO get(WorkflowNodeEntity workflowNodeEntity) throws XbbException;

    /**
     * 检验方法
     * @param workflowNodeEntity
     * @param nodeMap
     * @param workflowGetPojo
     * @return
     * @throws XbbException
     */
    WorkflowEnableVO check(WorkflowNodeEntity workflowNodeEntity, Map<Long, WorkflowNodeEntity> nodeMap, WorkflowGetPojo workflowGetPojo) throws XbbException;

    /**
     * 替换掉原来的工作流节点id
     * @param workflowNodeEntityExt
     * @param workflowNodeMap
     * @throws XbbException
     */
    void replaceWorkflowNodeId(WorkflowNodeEntityExt workflowNodeEntityExt, Map<Long, Long> workflowNodeMap) throws XbbException;
}
